/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aaron.platform.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author mac
 */
@Entity
@Table(name = "itsc_role_privileges")
@SequenceGenerator(name="itsc_pri_generator", sequenceName="itsc_pri_generator", allocationSize = 1)
public class ItscRolePrivileges implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String RROPERTY_ROLE_ID = "roleId";

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="itsc_pri_generator")
    @Column(name = "role_pri_id")
    private Integer rolePriId;

    @Column(name = "role_id")
    private Integer roleId;

    @Column(name = "privilege_name")
    private String privilegeName;

    @Column(name = "privilege_value")
    private Integer privilegeValue;

    public ItscRolePrivileges() {
    }

    public ItscRolePrivileges(Integer rolePreId) {
        this.rolePriId = rolePreId;
    }

    public Integer getRolePriId() {
        return rolePriId;
    }

    public void setRolePriId(Integer rolePreId) {
        this.rolePriId = rolePreId;
    }

    public String getPrivilegeName() {
        return privilegeName;
    }

    public void setPrivilegeName(String privilegeName) {
        this.privilegeName = privilegeName;
    }

    public Integer getPrivilegeValue() {
        return privilegeValue;
    }

    public void setPrevilegeValue(Integer privilegeValue) {
        this.privilegeValue = privilegeValue;
    }


    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (rolePriId != null ? rolePriId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItscRolePrivileges)) {
            return false;
        }
        ItscRolePrivileges other = (ItscRolePrivileges) object;
        if ((this.rolePriId == null && other.rolePriId != null) || (this.rolePriId != null && !this.rolePriId.equals(other.rolePriId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aaron.test.entity.ItscRolePrivileges[rolePreId=" + rolePriId + "]";
    }

}
